#include <cstdio>
#include <algorithm>

using namespace std;

struct Node
{
    int a, id;
};

bool operator < ( const Node &a, const Node &b )
{
    if ( a.a != b.a )
        return a.a < b.a;
    return a.id > b.id;
}

int n, m;
Node a[ 10001 ];

void init( )
{
    int i;
    scanf("%d%d", &n, &m);
    for ( i = 0; i < m; i++ )
    {
        scanf("%d", &a[ i ].a);
        a[ i ].id = i;
    }
    sort( a, a + m );
}

void work( )
{
    int i, t = 0, p = n, j, s[ 10001 ];
    for ( i = 0; i < m; i++ )
    {
        //printf("%d\n", p);
        if ( p <= ( a[ i ].a - t ) * ( m - i ) )
        {
            for ( j = m - 1; j > m - 1 - p % ( m - i ); j-- )
                s[ a[ j ].id ] = t + p / ( m - i ) + 1;
            for ( j = m - 1 - p % ( m - i ); j >= i; j-- )
                s[ a[ j ].id ] = t + p / ( m - i );
            //printf("!%d %d\n", m - 1 - p % ( m - i ), i);
            p = 0;
            break;
        }
        p -= ( a[ i ].a - t ) * ( m - i );
        t = a[ i ].a;
        s[ a[ i ].id ] = t;
    }
    if ( p )
        puts("IMPOSSIBLE");
    else
    {
        printf("%d", s[ 0 ]);
        for ( i = 1; i < m; i++ )
            printf(" %d", s[ i ]);
        printf("\n");
    }
}

int main( )
{
    int t;
    scanf("%d", &t);
    while ( t-- )
    {
        init( );
        work( );
    }
    return 0;
}
